1. Technical Field
Embodiments of the present disclosure relate generally to clipping a known range of integer values by desired ceiling and floor values with reduced number of operations.
2. Related Art
Clipping refers to transforming a set of integer values to a same number of transformed values such that each transformed value equals a floor value if the corresponding integer value is less than the floor value, equals a ceiling value if the corresponding integer value is greater than the ceiling value, and equals the corresponding integer value itself otherwise.
There are situations in which such a set of integer values is within a known range, implying that there are specified upper and lower limits to the integer values that are to be transformed by a clipping operation. For example, a processor may provide pixel values (e.g., in RGB format) representing images of objects (physical), with the pixel values having a range wider than that desired (or meaningfully usable). The range of values of the pixels may then need to be clipped (using corresponding processor instructions), such that the clipped values lie within a range (often smaller than the original range) specified by desired ceiling and floor values.
It may be desirable to perform clipping with a reduced number of operations to meet one or more requirements such as, without limitation, reduce computation time in a processor, minimizing power consumption, etc.